#include <iostream>
#include <string>

int main()
{
    double f = 3.1415;
    std::string f_str = std::to_string(f);
    std::cout << f_str << "\n";


    std::string pi = "pi is " + std::to_string(3.1415926);
    std::string perfect = std::to_string(1+2+4+7+14) + " is a perfect number";

    std::cout << pi << '\n';
    std::cout << perfect << '\n';


    double f_str_f = std::atof(f_str.data());
    std::cout << f_str_f << "\n";

    int perfect_int = std::atoi(perfect.data());
    std::cout << perfect_int << "\n";
    int err = std::atoi("a"); //err  = -1
    std::cout << err << "\n";

    return 0;

}
